﻿using FreeSql;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BBCore.Core.Models.Admins
{
    /// <summary>
    /// 数字字典数据实体
    /// </summary>
    [Table(Name = "HYJ_SysDictData")]
    [Description("数字字典数据实体")]
    //[Index("uk_Label_Value", "Label,Value", true)] //唯一键
    public class SysDictData : BaseEntity<SysDictData, int>
    {
        [Display(Name = "类型ID")]
        public int TypeId { get; set; }

        [Column(StringLength = 50)]
        [Display(Name = "字典Key")]
        [Required(ErrorMessage = "字典Key不能为空")]
        public string? Label { get; set; }

        [Column(StringLength = 50)]
        [Display(Name = "字典Value")]
        [Required(ErrorMessage = "字典Value不能为空")]
        public string? Value { get; set; }

        [Display(Name = "是否启用")]
        public bool Status { get; set; } = true;
        [Navigate(nameof(TypeId))]
        public SysDictType? DictType { get; set; }
    }
}
